package day01;

import java.util.Arrays;

public class P05StaticMethodPassValue {

    static void foo(int x){
        ++x;
    }
    public static void main(String[] args) {
        int x=3;
        foo(x);
        System.out.println(x);
        int a=3,b=4;
        swap(a,b);
        System.out.println(String.format("a=%d b=%d",a,b));

        int[] arr=new int[]{1,2,3,};
        foo(arr);

        System.out.println(Arrays.toString(arr));

    }

    private static void foo(int[] arr) {
        ++arr[0];//ok
    }

    private static void swap(int a, int b) {
        int t=a;
        a=b;
        b=t;
    }


}
